package everyday3;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Siantar
 * @Date: 2023-07-13-13:47
 * @Description: 1.0
 */
public class T0728 {
    public List<Integer> selfDividingNumbers(int left, int right) {
        List<Integer> res = new ArrayList<>();
        for (int i = left; i <= right; i++) {
            int p = i;
            while (p != 0) {
                if (p % 10 == 0 || i % (p % 10) != 0) break;
                p = p / 10;
            }
            if (p == 0) res.add(i);
        }
        return res;
    }
}
